﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:shmp_styles="clr-namespace:SharpMap.Styles;assembly=SharpMap"
  	xmlns:reflect="clr-namespace:System.Reflection;assembly=mscorlib"
    
    xmlns:local="clr-namespace:SharpMap.Presentation.Wpf"
    xmlns:cnv="http://schemas.kent.boogaart.com/converters"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    >

    
    
    
  <ObjectDataProvider x:Key="ColorsProvider"
            MethodName="GetProperties"
            ObjectType="{x:Type local:TypePropertyBinder}">
    <ObjectDataProvider.MethodParameters>
      <x:Type TypeName="Colors"/>
    </ObjectDataProvider.MethodParameters>
  </ObjectDataProvider>
    
  
    
    <!--Color Combo Style-->
    <Style x:Key="ColorComboStyle">
        <Setter Property="ComboBox.ItemsSource"
                Value="{Binding Mode=OneTime, Source={StaticResource ColorsProvider}}"/>
        
        

        <Setter Property="ComboBox.ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <ComboBoxItem Name="comboItem">
                        <StackPanel Orientation="Horizontal">
                            <Grid>
                                <Rectangle Width="10" Height="10" Stroke="#FF000000">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{Binding Name, Mode=OneTime}"/>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                            <TextBlock Text="{Binding Name, Mode=OneTime}"/>
                         </StackPanel>
                    </ComboBoxItem >

                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <DataTemplate DataType="{x:Type Brush}">
          <TextBox Text="{Binding Path=Color}"/>
        <!--<ComboBox 
            Style="{StaticResource ColorComboStyle}">
            <ComboBox.SelectedItem>
                <Binding Path="Content" RelativeSource="{RelativeSource TemplatedParent}" Converter="{cnv:TypeConverter sys:String, SolidColorBrush}"/>
            </ComboBox.SelectedItem>
            
        </ComboBox>--> 
   
    </DataTemplate>

    <DataTemplate DataType="{x:Type Pen}">
        <TextBox Text="{Binding Path=Thickness}"/>
    </DataTemplate>


</ResourceDictionary>
